<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <title>公信商城－首页</title>

    <!--图标字体 http://fontawesome.io/icons/ -->
    <link rel="stylesheet" href="css/font/css/font-awesome.min.css" />
    <link rel="stylesheet" href="css/ui-base.css"/>
    <link rel="stylesheet" href="css/main.css"/>
    <script src="js/jquery.min.js"></script>
    <!--<script src="js/loaderMask.js"></script>-->
</head>
<body>
    <header class="header">
        <span class="title">首页</span>
        <span class="l-btn l-sort" id="l-sort"></span>
        <a class="r-btn r-pcenter" href="personalCenter.html"></a>
    </header>

    <div class="content w100 ho po-r">
        <!--分类弹窗-->
        <div class="windows-sort ho">
            <ul class="ho">
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
                <li><a href="sortPage.html">居家生活</a></li>
            </ul>
        </div>
        <div class="mask" ></div>
        <!--公信人-->
        <div class="gxr-list ho">
            <ul class="ho">
                <!--固定-->
                <li><img src="images/mainpage/gxr.png" alt=""/></li>
                <li><img src="images/mainpage/gxr01.jpg" alt=""/></li>
                <li><img src="images/mainpage/xlx.png" alt=""/></li>
                <li><img src="images/mainpage/gxr02.jpg" alt=""/></li>
                <!--动态获取-->
                <li><a href="personalPage.html"><img src="images/mainpage/gxr03.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr04.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr05.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr06.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr05.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr07.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr08.jpg" alt=""/></a></li>
                <li><a href="personalPage.html"><img src="images/mainpage/gxr03.jpg" alt=""/></a></li>
            </ul>
        </div>

        <!--分类推荐-->
        <div class="best-sort w100 ho">
            <div class="ho margin-b bac-w">
                <a class="f-l" href="sortPage.html"><img src="images/mainpage/best-sort01.jpg" alt=""/></a>
                <a class="f-r" href="sortPage.html"><img src="images/mainpage/best-sort02.jpg" alt=""/></a>
            </div>
            <div class="ho bac-w">
                <a class="f-l" href="sortPage.html"><img src="images/mainpage/best-sort03.jpg" alt=""/></a>
                <a class="f-r" href="sortPage.html"><img src="images/mainpage/best-sort04.jpg" alt=""/></a>
                <a class="f-l" href="sortPage.html"><img src="images/mainpage/best-sort05.jpg" alt=""/></a>
            </div>

        </div>
        <!--商品推荐-->
        <div class="best-goods ho">
            <img src="images/mainpage/best-goods-tt.jpg"/>
            <ul class="w100 ho">
                <li>
                    <a class="goods-details ho" href="details.html">
                        <img src="images/mainpage/goods-img02.jpg" />
                        <p class="description">德国进口爱他美1+段 600g 婴幼儿配方奶粉婴幼儿配方奶粉婴幼儿配方奶粉</p>
                        <span class="price">￥189</span>
                    </a>
                </li>
                <li>
                    <a class="goods-details ho" href="details.html">
                        <img src="images/mainpage/goods-img02.jpg" />
                        <p class="description">德国进口爱他美1+段 600g 婴幼儿配方奶粉婴幼儿配方奶粉婴幼儿配方奶粉</p>
                        <span class="price">￥189</span>
                    </a>
                </li>
                <li>
                    <a class="goods-details ho" href="details.html">
                        <img src="images/mainpage/goods-img02.jpg" />
                        <p class="description">德国进口爱他美1+段 600g 婴幼儿配方奶粉婴幼儿配方奶粉婴幼儿配方奶粉</p>
                        <span class="price">￥189</span>
                    </a>
                </li>
                <li>
                    <a class="goods-details ho" href="details.html">
                        <img src="images/mainpage/goods-img02.jpg" />
                        <p class="description">德国进口爱他美1+段 600g 婴幼儿配方奶粉婴幼儿配方奶粉婴幼儿配方奶粉</p>
                        <span class="price">￥189</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>


    <script>
        $(function () {
            var hh = -($('.windows-sort').outerHeight()) + 'px';
            $('.windows-sort').css('top',  hh);
            /*分类菜单*/
            $('.l-sort').on('click', function (event) {
                var text = $('.header').find('.title').html();
                if (text == "首页") {
                    showWindows(hh);
                } else {
                    hideWindows(hh);
                }
                //停止冒泡
                event = event || window.event;
                //event.stopPropagation();
                //如果提供了事件对象，则这是一个非IE浏览器
                if ( event && event.stopPropagation ) {
                    //因此它支持W3C的stopPropagation()方法
                    event.stopPropagation();
                } else {
                    //否则，我们需要使用IE的方式来取消事件冒泡
                    window.event.cancelBubble = true;
                    return false;
                }
                //如果提供了事件对象，则这是一个非IE浏览器
                if ( event && event.preventDefault ) {
                　　//阻止默认浏览器动作(W3C)
                　　event.preventDefault();
                } else {
                　　//IE中阻止函数器默认动作的方式
                　　window.event.returnValue = false;
                }
            });
            $(document).on('click', function (event) {
                event = event || window.event;
                var curEl = event.srcElement || event.target;
                if (curEl.id !== "l-sort") {
                    hideWindows(hh);
                }
            });
            /*$('.mask').on('click', function () {
             hideWindows();
             });*/
            function showWindows (hh) {
                $('.header').find('.title').html('分类');
                $('.windows-sort').animate({top: '3em'}, 600);
                $('.mask').show();
            }
            function hideWindows (hh) {
                $('.header').find('.title').html('首页');
                $('.windows-sort').animate({top: hh}, 600);
                $('.mask').hide();
            }
        });
    </script>
</body>
</html>